import axios from "@/utils/request.js";


/**
 * 上传文件
 * @param {*} file 
 * @returns 
 */
export const fileUploadService = (file) => {
  return axios.post("/file/uploadImage",{file},{
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

/**
 * 下载图片
 * @param {*} filePath 
 * @returns 
 */
export const fileDownloadService = (filePath) => {
  return axios.get("/file/downloadImage",{
    params:{filePath: filePath},
    responseType: 'blob', // 确保响应类型是 blob
  })
}